﻿/*#region Sidebar*/
.page-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 224px;
    display: block;

    &.sidebar-fixed {
        position: fixed;
        top: 45px;
        float: none !important;
        z-index: 1000;

        &:before {
            height: 5000px;
            top: 45px;
            bottom: auto;
        }
    }

    &.hide {
        display: none !important;

        &:before {
            display: none;
        }

        ~ .page-content {
            margin-left: 0 !important;

            .breadcrumbs-fixed {
                left: 0 !important;
            }

            .page-header-fixed {
                left: 0 !important;
            }
        }
    }

    &:before {
        content: "";
        position: fixed;
        display: block;
        width: 219px;
        bottom: 0;
        top: 0;
        left: 5px;
        background-color: @white;
        .box-shadow( 0 0 10px 0 @black2);
        z-index: 1;
    }

    .sidebar-header-wrapper {
        margin-left: 5px;
        height: 40px;
        margin-bottom: 0;
        position: relative;

        .searchinput {
            height: 41px;
            z-index: 2;
            background-color: @white;
            display: block;
            position: absolute;
            top: 0;
            left: 0;
            border: 1px solid @white;
            padding-left: 40px;
            width: 100%;

            &:focus {
                .box-shadow(none);
                border-color: @white;

                ~ .searchhelper {
                    display: block;
                    z-index: 124;
                }
            }

            &::-webkit-input-placeholder {
                color: @lightgray;
                font-weight: 300;
                font-family: @main-fonts;
            }

            &::-moz-placeholder { /* Firefox 19+ */
                color: @lightgray;
                font-weight: 300;
                font-family: @main-fonts;
            }

            &:-moz-placeholder { /* Firefox 19+ */
                color: @lightgray;
                font-weight: 300;
                font-family: @main-fonts;
            }

            &:-ms-input-placeholder {
                color: @lightgray;
                font-weight: 300;
                font-family: @main-fonts;
            }
        }

        .searchicon {
            cursor: pointer;
            display: inline-block;
            height: 12px;
            left: 20px;
            position: absolute;
            top: 14px;
            width: 12px;
            color: @themeprimary;
            z-index: 124;
        }

        .searchhelper {
            .box-shadow( 0 10px 40px rgba(0,0,0,.4));
            background-color: #fff;
            color: #999;
            display: none;
            opacity: 1;
            padding: 10px;
            position: absolute;
            right: 0;
            left: 0;
            top: 40px;
            z-index: 4;
        }
    }

    .sidebar-menu {
        margin: 0;
        padding: 0;
        list-style: none;
        margin-left: 5px;

        a {
            display: block;
            height: 38px;
            line-height: 36px;
            margin: 0;
            padding: 0 16px 0 7px;
            .text-shadow(none) !important;
            font-size: 13px;
            text-decoration: none;
            color: @sonic-silver;
            z-index: 123;

            &:hover {
                color: @darkcarbon;

                &:before {
                    display: block;
                }
            }

            .menu-icon {
                display: inline-block;
                vertical-align: middle;
                min-width: 30px;
                text-align: center;
                font-size: 14px;
                font-weight: normal;
                font-style: normal;
                margin-top: -3px;
            }

            .menu-expand {
                display: inline-block;
                position: absolute;
                font-size: 13px;
                line-height: 10px;
                height: 10px;
                width: 10px;
                right: 12px;
                top: 15px;
                margin: 0;
                text-align: center;
                padding: 0;
                .text-shadow(none);
                color: @storm-cloud;
                .transition(all 300ms ease-in-out);
                font-family: @fontawesome-font;
                font-style: normal;
                font-weight: normal;

                &:before {
                    content: "\f105" /*rtl:"\f104"*/;
                }
            }
        }

        li {
            display: block;
            padding: 0;
            margin: 0;
            border: 0;
            position: relative;

            &:before {
                display: none;
                content: "";
                position: absolute;
                top: 0;
                bottom: 0;
                left: -4px;
                width: 4px;
                max-width: 4px;
                overflow: hidden;
                background-color: @themeprimary;
            }

            &.open {
                background-color: @white;

                > a {
                    color: @darkcarbon;

                    .menu-expand {
                        .transform(rotate(90deg));
                    }
                }

                > .submenu {
                    display: block !important;
                }
            }

            &.active {
                &:not(.open) {
                    &:before {
                        display: block;
                    }
                }


                > a {
                    display: block;
                    content: "";
                    color: @darkcarbon;
                    background-color: @whitesmoke;
                }
            }

            &:not(.open) {
                &:hover {
                    &:before {
                        display: block;
                        background-color: @themesecondary;
                    }
                }
            }
        }

        > li {
            > a {
                border-top: 1px solid @seashell;

                &:hover {
                    border-color: @seashell;
                    background-color: @snow;
                }
            }

            &:last-child {
                > a {
                    border-bottom: 1px solid @seashell;
                }
            }

            > .submenu {
                background-color: @snow;
                .box-shadow(inset 0 4px 4px -2px rgba(0, 0, 0, 0.15), inset 0 -4px 4px -2px rgba(0, 0, 0, 0.15));

                &:before {
                    content: "";
                    display: block;
                    position: absolute;
                    z-index: 1;
                    left: 23px;
                    top: 0;
                    bottom: 19px;
                    border-left: 1px solid #e2e2e2;
                }

                > li {
                    > a:before {
                        content: "";
                        display: inline-block;
                        position: absolute;
                        width: 5px;
                        height: 5px;
                        left: 21px;
                        top: 17px;
                        background-color: @white;
                        border: 1px solid #e2e2e2;
                        z-index: 2;
                    }

                    &.active {
                        > a:before {
                            background-color: #e2e2e2;
                        }

                        &:first-child {
                            > a {
                                .box-shadow(inset 0 4px 4px -2px rgba(0, 0, 0, 0.15));
                            }
                        }

                        &:last-child {
                            a {
                                .box-shadow(inset 0 -4px 4px -2px rgba(0, 0, 0, 0.15));
                            }
                        }
                    }
                }
            }

            &.open {
                > a {
                    background-color: @white;
                }
            }
        }

        .submenu {
            display: none;
            list-style: none;
            margin: 0;
            padding: 0;
            position: relative;
            background-color: @snow;
            border-top: 0;
            z-index: 123;

            li {
                margin-left: 0;
                position: relative;

                &.open {
                    &:before {
                        display: none;
                    }
                }

                &.active {
                    > a {
                        color: @darkcarbon;
                        background-color: @whitesmoke;
                    }

                    > .submenu {
                        display: block;
                    }
                }
            }

            > li {
                > a {
                    padding-left: 40px;
                }

                &.open {
                    > a {
                        background-color: @snow;
                    }
                }

                .submenu {
                    border-top: 1px solid @ivory;
                    border-bottom: 1px solid @ivory;

                    > li {
                        > a {
                            padding-left: 50px;
                        }

                        .submenu {
                            > li {
                                > a {
                                    padding-left: 70px;
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    &.menu-compact {
        width: 42px;

        ~ .page-content {
            margin-left: 43px;

            .breadcrumbs-fixed {
                left: 47px;
            }

            .page-header-fixed {
                left: 47px;
            }
        }

        &:before {
            width: 42px;
        }

        .sidebar-header-wrapper {
            width: 42px;

            &:hover {
                width: 238px;

                .searchinput {
                    .box-shadow( 0 10px 40px rgba(0,0,0,.4));
                }
            }

            .searchinput {
                &:focus {
                    width: 238px;
                    .box-shadow( 0 10px 40px rgba(0,0,0,.4));

                    ~ .searchhelper {
                        width: 238px;
                    }
                }
            }

            .searchicon {
                left: 15px;
            }
        }

        .sidebar-menu {
            width: 42px;

            > li {
                &.open {
                    > .menu-text {
                        display: none !important;
                    }

                    > .submenu {
                        display: none !important;
                    }
                }

                &:hover {
                    > a {
                        color: @darkcarbon;

                        > .menu-text {
                            display: block;
                        }
                    }

                    > .submenu {
                        display: block !important;
                    }
                }

                > a {
                    position: relative;
                    z-index: 123;

                    .menu-text {
                        display: none;
                        position: absolute;
                        left: 42px;
                        top: 0;
                        width: 195px;
                        height: 38px;
                        line-height: 38px;
                        background-color: @white;
                        z-index: 121;
                        padding-left: 25px;
                        .box-shadow(5px 5px 5px -5px @black3, 5px 5px 5px -5px @black3, 5px -5px 5px -5px @black3);
                    }

                    .menu-expand {
                        display: none;
                    }

                    &.menu-dropdown {
                        .box-shadow(none);

                        > .menu-text {
                            border: 0;
                            top: 0;
                            left: 42px;
                            width: 195px;
                            border-bottom: 1px solid @seashell;
                            .box-shadow(none);
                        }
                    }

                    &:hover {
                        background-color: @white;
                    }
                }

                > .submenu {
                    background: @snow;
                    position: absolute;
                    z-index: 120;
                    left: 42px;
                    top: 0;
                    width: 195px;
                    .box-shadow(none);
                    padding-top: 38px;
                    display: none;
                    border-left: 1px solid @seashell;
                    .box-shadow(5px 5px 5px -5px @black3, 5px 5px 5px -5px @black3, 5px -5px 5px -5px @black3);


                    li {

                        > a {
                            margin-left: 0;
                            padding-left: 24px;
                        }

                        &.open {
                            > .submenu {
                                display: block;
                                left: 0;
                                position: relative;
                                .box-shadow(none);
                            }
                        }

                        .submenu {
                            display: none;
                            list-style: none;
                            margin: 0;
                            padding: 0;
                            position: relative;
                        }

                        &:hover {
                            background-color: @white;

                            &:before {
                                display: block;
                                left: 0;
                            }
                        }

                        &.active {
                            &:not(.open) {
                                &:before {
                                    left: 0;
                                }
                            }
                        }
                    }

                    &:before {
                        display: none;
                    }

                    > li {
                        > a {
                            .box-shadow(none) !important;

                            &:before {
                                display: none;
                            }
                        }
                    }
                }
            }
        }
    }
}

@media only screen and (max-width:880px) {
    .page-sidebar:before {
        display: none;
    }

    .page-sidebar {
        display: none;
        float: none;
    }

    .breadcrumbs-fixed {
        left: 0 !important;
    }

    .page-header-fixed {
        left: 0 !important;
    }
}

@media (max-width: 880px) {
    .page-sidebar {
        &.hide {
            display: block !important;

            &:before {
                display: block !important;
            }

            ~ .page-content {
                margin-left: 224px !important;

                .breadcrumbs-fixed {
                    left: 224px !important;
                }

                .page-header-fixed {
                    left: 224px !important;
                }
            }
        }

        &.menu-compact {
            ~ .page-content {
                margin-left: 0;

                .breadcrumbs-fixed {
                    left: 0;
                }

                .page-header-fixed {
                    left: 0;
                }
            }

            &.hide {

                ~ .page-content {
                    margin-left: 46px !important;

                    .breadcrumbs-fixed {
                        left: 46px !important;
                    }

                    .page-header-fixed {
                        left: 46px !important;
                    }
                }
            }
        }
    }
}

@media (max-width: 500px) {
    .page-sidebar {
        &.hide {
            ~ .page-content {
                .page-header {
                    .header-title {
                        display: none;
                    }

                    .header-buttons {
                        .refresh, .fullscreen {
                            display: none;
                        }
                    }
                }
            }
        }

        &.menu-compact {
            &.hide {
                ~ .page-content {
                    .page-header {
                        .header-buttons {
                            .refresh, .fullscreen {
                                display: inline-block;
                            }
                        }
                    }
                }
            }
        }
    }
}
/*#endregion Sidebar*/
